-
Notifications
You must be signed in to change notification settings - Fork 10
Copy witness policy file format code from Tessera #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This allows the required witnesses to be defined and the theshold policies that apply within each group. Arbitrarily nested structures can be built, each with different numbers of signatures. Each WitnessGroup provides the URLs at which the witness can be reached to perform witnessing, and a function that determines if the group is satisfied. This format is consistent with the only other known witness policy configuration format out there: https://git.glasklar.is/sigsum/core/sigsum-go/-/blob/main/doc/policy.md Towards #309.
Towards #309.
This now verifies the body of 200 responses. It checks that the note can be verified using the signature, and then returns only the signature that the log has a verifier for. This means that witnesses that return a valid signature and then a load of other signatures will not be able to pollute the checkpoint with these other signatures. On the other hand, it means we will need to consider how to support witness key rotation in Tessera in the future. There are a few ways to solve this, but I don't believe this approach blocks any of them.
Duplicate docs instead of linking to private docs
A few bits to clean up as we approach a beta release: - Pruned utility method from API - Renamed IntegrationAwaiter to PublicationAwaiter - Modernized some older go idioms
This PR adds support for constructing a graph of WitnessGroup/Witness structs which represent the policy defined in a config file complying with the spec here: https://git.glasklar.is/sigsum/core/sigsum-go/-/blob/main/doc/policy.md
* Bump formats to 404c0d5 & tidy * Add 0x04 key to policy tests
Makes it easier to find the option to configure witnesses using a policy file, and clarifies that it expects vkey cosig keys for witnesses.
Signed-off-by: Hayden <8418760+Hayden-IO@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #229 +/- ##
==========================================
- Coverage 82.57% 73.80% -8.78%
==========================================
Files 5 7 +2
Lines 241 500 +259
==========================================
+ Hits 199 369 +170
- Misses 30 74 +44
- Partials 12 57 +45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
AlCutter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's an opportunity to improve naming on a couple of things taking advantage of the new witness package name:
witness.NewWitness-->witness.Newwitness.WitnessGroup-->witness.Groupwitness.NewWitnessGroup-->witness.NewGroupwitness.NewWitnessGroupFromPolicy-->witness.ParsePolicy
Perhaps the ones in tessera can then become deprecated type aliases for these until v2.0.0.
@Hayden-IO @mhutchinson @roger2hk thoughts?
This is a good suggestion. The naming aligns with the Go Style Best Practice. Type aliases provide a path to deprecation in Tessera v2. https://google.github.io/styleguide/go/best-practices#avoid-repetition |
Signed-off-by: Hayden <8418760+Hayden-IO@users.noreply.github.com>
0cb49bf to
b1c92b7
Compare
|
Agreed! I've updated the names. |
This moves the witness code, which implements https://c2sp.org/tlog-witness and https://git.glasklar.is/sigsum/core/sigsum-go/-/blob/main/doc/policy.md (with a slight variation of key format) to this low-dependency repo. Moving this out of the Tessera codebase lets verifiers verify witness cosigntures on checkpoints without also depending on Tessera, only needing transparency-dev/formats and transparency-dev/merkle.
I preserved the git history with git-filter-repo. When merging, this should be either merged or rebased onto main to preserve the history. Also note the license remains unchanged.